import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']='SimHei'#设置中文显示

plt.rcParams['font.size'] = 14
plt.figure(figsize=(6,6))#将画布设定为正方形，则绘制的饼图是正圆
label=['发电机','叶片','轴承','塔筒','变桨','主轴']  #定义饼图的标签，标签是列表
values=[120,80,10,10,60,60]
plt.pie(values,labels=label,autopct='%1.1f%%')#绘制饼图

plt.title("故障总览",x=0.05,y=0.85,fontdict=dict(fontsize=30))
plt.savefig('4.png', transparent=True)
plt.show()
